// 平台属性页面相关api
import productRequest from '@/utils/productRequest'

// 获取一级分类数据
// /admin/product/getCategory1  get
export const reqCategoryList1 = () => productRequest({ url: '/admin/product/getCategory1', method: 'get' })

// 获取二级分类数据
// /admin/product/getCategory2/{category1Id}  get
export const reqCategoryList2 = (category1Id) => productRequest({ url: `/admin/product/getCategory2/${category1Id}`, method: 'get' })

// 获取三级分类数据
// /admin/product/getCategory3/{category2Id}  get
export const reqCategoryList3 = (category2Id) => productRequest({ url: `/admin/product/getCategory3/${category2Id}`, method: 'get' })

// 获取平台属性列表数据
// /admin/product/attrInfoList/{category1Id}/{category2Id}/{category3Id}   get
export const reqGetAttrInfoList = (category1Id, category2Id, category3Id) => productRequest({ url: `/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`, method: 'get' })

// 添加平台属性
// /admin/product/saveAttrInfo   post
export const reqAddOrUpdataAttr = (data) => productRequest({ url: `/admin/product/saveAttrInfo`, method: 'post', data })

// 删除平台属性
// /admin/product/deleteAttr/{attrId}  detele
export const reqDeleteAttr = (attrId) => productRequest({ url: `/admin/product/deleteAttr/${attrId}`, method: 'DELETE' })